﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Member_Login_Login_v1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["ErrLogin"] != null)
        {
            string head = "";
            string pathThemes = ResolveUrl("~/App_Themes");
            head += "<title>Login!!!</title>";
            //if (int.Parse(System.DateTime.Now.Hour.ToString()) >= 6 && int.Parse(System.DateTime.Now.Hour.ToString()) < 12)
            //{
            //    head += "<link href='" + pathThemes + "/BlueSkin/BodyStyles.css' rel='stylesheet' type='text/css'/> ";
            //    head += "<link href='" + pathThemes + "/BlueSkin/ProductStyles.css' rel='stylesheet' type='text/css'/> ";
            //    head += "<link href='" + pathThemes + "/BlueSkin/MenuStyles.css' rel='stylesheet' type='text/css'/> ";
            //    head += "<link href='" + pathThemes + "/BlueSkin/RegisterStyles.css' rel='stylesheet' type='text/css'/> ";
            //    head += "<link href='" + pathThemes + "/BlueSkin/NewsStyles.css' rel='stylesheet' type='text/css'/> ";

            //}
            //else if (int.Parse(System.DateTime.Now.Hour.ToString()) >= 12 && int.Parse(System.DateTime.Now.Hour.ToString()) < 18)
            //{
            //    head += "<link href='" + pathThemes + "/GreenSkin/BodyStyles.css' rel='stylesheet' type='text/css'/> ";
            //    head += "<link href='" + pathThemes + "/GreenSkin/ProductStyles.css' rel='stylesheet' type='text/css'/> ";
            //    head += "<link href='" + pathThemes + "/GreenSkin/MenuStyles.css' rel='stylesheet' type='text/css'/> ";
            //    head += "<link href='" + pathThemes + "/GreenSkin/RegisterStyles.css' rel='stylesheet' type='text/css'/> ";
            //    head += "<link href='" + pathThemes + "/GreenSkin/NewsStyles.css' rel='stylesheet' type='text/css'/> ";

            //}
            //else
            //{
            head += "<link href='" + pathThemes + "/BlackSkin/BodyStyles.css' rel='stylesheet' type='text/css'/> ";
            head += "<link href='" + pathThemes + "/BlackSkin/ProductStyles.css' rel='stylesheet' type='text/css'/> ";
            head += "<link href='" + pathThemes + "/BlackSkin/MenuStyles.css' rel='stylesheet' type='text/css'/> ";
            head += "<link href='" + pathThemes + "/BlackSkin/RegisterStyles.css' rel='stylesheet' type='text/css'/> ";
            head += "<link href='" + pathThemes + "/BlackSkin/NewsStyles.css' rel='stylesheet' type='text/css'/> ";
            // }

            headMaster.InnerHtml = "";
            headMaster.InnerHtml = head;

            if (Session["ErrLogin"].ToString() == "Y")
            {
                lblErrLogin.Text = "Lỗi đăng nhập!!!";
            }
            else if (Session["ErrLogin"].ToString() == "B")
            {
                lblErrLogin.Text = "Vui lòng đăng nhập để có thể hoàn tất đơn đặt hàng!!!";
            }
            //else if(Session["ErrLogin"].ToString() =="N")
            //{
            //    Response.Redirect(Request.ServerVariables["HTTP_REFERER"]);
            //}
        }



    }
}
